/*
 * @Author: your name
 * @Date: 2021-12-19 18:57:14
 * @LastEditTime: 2021-12-19 20:19:50
 * @Descripttion: 描述
 */
#include "select_itemv3.h"
using namespace std::placeholders;
SelectItemV3::SelectItemV3(std::unique_ptr<Widget> &page)
    : /*SecondView(2, page),*/ PrimaryContrl(page)
{
    // setEvent[static_cast<int>(KeyboardValue::KEY_DIRECTION_LEFT)] = {std::bind(&SelectItemV3::GroupSelectLeft, this, _1)};
    // setEvent[static_cast<int>(KeyboardValue::KEY_DIRECTION_RIGHT)] = {std::bind(&SelectItemV3::GroupSelectRight, this, _1)};
    SaveItem();
    SwitchItem();
}
SelectItemV3::~SelectItemV3()
{
    SaveItemExit();
    SwitchItemExit();
}
void SelectItemV3::GroupSelectLeft(void *ctx)
{
    /**
     * @brief 
     * 把左右键切换成上下选择键。
     */
    Context context;
    KeyboardValue key = KeyboardValue::KEY_DIRECTION_UP;
    context.ctx = &key;
    // Select(&context);
}
void SelectItemV3::GroupSelectRight(void *ctx)
{
    /**
     * @brief 
     * 把左右键切换成上下选择键。
     */
    Context context;
    KeyboardValue key = KeyboardValue::KEY_DIRECTION_DOWN;
    context.ctx = &key;
    // Select(&context);
}
// void SelectItemV3::Select(void *ctx)
// {
//     /**
//      * @brief Construct a new Second View:: Select object
//      * 此处仅仅做选择处理，不对设置项进行二次操作。
//      */
//     SecondView::Select(ctx);
// }